/*
* Universal Command Utility
*/
/*
Copyright Polyakov Mark (qshadowp) 2012.
GNU GPLv3
*/
 
 package system.apps;
 
 import system.staros.ablock1.*;
 import system.staros.ablock2.*;
 import java.lang.*;
 import system.util.*;
 import java.util.*;
 import java.io.*;
 import java.net.*;
  public class ucu extends AppBase {
	public void run () {
		println ("You can't run <aam> in the background");
 	}
 	public String getVersion(){
	return "1.0";
	}
 	public int main ( String args[] ) {
	
 		if (args.length==1){
		if (args[0].equalsIgnoreCase("-h")){	
		System.out.println(" - Universal Command Util  v1.0 -");
		System.out.println(" - Flags: -");
		System.out.println("  -h : Help");
		System.out.println("  -r : Reboot");
		System.out.println("  -s : Shutdown");
		System.out.println("  -u : Download update");
		System.out.println("  -ch: Force check for updates");
		} else if (args[0].equalsIgnoreCase("-u")){try{System.out.println("Updating..."); 
		Updater.downloadUpdate();} catch (Exception e){e.printStackTrace();}} else if (args[0].equalsIgnoreCase("-r")){ } else
		if (args[0].equalsIgnoreCase("-s")){
		SysUtils.shutdown();// Shutting down... Not computer. StarOS only.
		}
		else if (args[0].equalsIgnoreCase("-ch")){
		/* Force checking updates */
		Updater.checkUpdates();
		}
		}
		
 	return 0;
	}
 	
 }